-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[CLI as MCP] Initialize Local MCP Server #9013
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Validation for Breaking Change Starting...
Thanks for your contribution! |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
src/mcp-server/azext_mcp/server.py
Outdated
| super().resource( | ||
| "az://{command_name_path}", | ||
| name="Azure CLI Command Help", | ||
| description="Retrieve comprehensive help documentation for Azure CLI commands and command groups. " | ||
| "Provides detailed information including command syntax, parameters, examples, and usage patterns. " | ||
| "Path format: 'az://command/subcommand' (e.g., 'az://login', 'az://vm/create', 'az://storage/account/list')", | ||
| mime_type="application/json", | ||
| )(self.command_help_resource) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't work because the implemetation of MCP python package has only very basic support of RFG 6570. modelcontextprotocol/python-sdk#378
|
Can boost this work, AWS has released something similar https://github.com/awslabs/mcp/tree/main/src/aws-api-mcp-server |
This is a very initial idea of a Local MCP server, which I name it "CLI as MCP".
Azure CLI could provide a command
az mcp upto serve as a local MCP server through stdio.Through this way, Azure CLI could integrate with VSCode Copilot Chat and other MCP client.
How to Install
Build the mcp server and install it as an Azure CLI extension.
Enable MCP Server in VSCode
In VSCode, click the tools icon in Copilot Chat.





Select
Add More ToolsSelect
Add MCP Server...Select the
Command(stdio)typeInput
az mcp upto start the Local MCP ServerEnable MCP Server in VSCode (Alternative)
Add a new file named
mcp.jsonin.vscodefolder. Add the following config in this file:{ "servers": { "AzureLocalMcpServer": { "type": "stdio", "command": "az", "args": [ "mcp", "up" ] } }, "inputs": [] }How to use
After adding the Server, you should see two new tools in your toolset.

You can now use it in the Agent Mode!

This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
az mcp upGeneral Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally? (pip install wheel==0.30.0required)For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update
src/index.jsonautomatically.You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify
src/index.json.